package com.byzk.p2p.admin.system.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.byzk.p2p.admin.base.util.PageInfo;
import com.byzk.p2p.admin.system.dao.UserVerifyResultDao;
import com.byzk.p2p.admin.system.dto.UserVerifyResult;

@Service
public class UserVerifyResultService {
	@Autowired
	private UserVerifyResultDao userVerifyResultDao;
	/**
	 * 遍历用户认证记录
	 * @param queryMap
	 * @param index
	 * @param limit
	 * @return
	 */
	public PageInfo<UserVerifyResult> listAll(Map<String, Object> queryMap,Integer index,Integer limit) {
		if (index != null && limit != null) {
			if (queryMap == null) {
				queryMap = new HashMap<String, Object>();
			}
			queryMap.put("start", (index-1)*limit);
			queryMap.put("limit", limit);
		}			
		Integer total = userVerifyResultDao.count(queryMap);
		List<UserVerifyResult> list = userVerifyResultDao.listAll(queryMap);
		PageInfo<UserVerifyResult> pageInfo = new PageInfo<UserVerifyResult>(total, index, limit);
		pageInfo.setPageList(list);
		return pageInfo;
	}
	
	
}
